<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Add a new type to a model</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="sdo-das-datafactory.addpropertytotype.html">SDO_DAS_DataFactory::addPropertyToType</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="sdo-das-datafactory.getdatafactory.html">SDO_DAS_DataFactory::getDataFactory</a></div>
 <div class="up"><a href="ref.sdo.html">SDO 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="sdo-das-datafactory.addtype" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SDO_DAS_DataFactory::addType</h1>
  <p class="verinfo">(^)</p><p class="refpurpose"><span class="refname">SDO_DAS_DataFactory::addType</span> &mdash; <span class="dc-title">
   Add a new type to a model
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-sdo-das-datafactory.addtype-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>SDO_DAS_DataFactory::addType</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$type_namespace_uri</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$type_name</code></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$options</code></span>
  ] )</div>


  <div class="warning"><strong class="warning">Warning</strong><p class="simpara">此函数是<em class="emphasis">实验性</em>的。此函数的表象，包括名称及其相关文档都可能在未来的
PHP 发布版本中未通知就被修改。使用本函数风险自担 。</p></div>

  <p class="para">
   Add a new type to the SDO_DAS_DataFactory, 
   defined by its namespace and type name.
   The type becomes part of the model of data objects 
   that the data factory can create.
  </p>

 </div>

 <div class="refsect1 parameters" id="refsect1-sdo-das-datafactory.addtype-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>

      <em><code class="parameter">type_namespace_uri</code></em>
     </dt>

     <dd>

      <p class="para">
       The namespace of the type.
      </p>
     </dd>

    
    
     <dt>

      <em><code class="parameter">type_name</code></em>
     </dt>

     <dd>

      <p class="para">
       The name of the type.
      </p>
     </dd>

    
    
     <dt>

      <em><code class="parameter">options</code></em>
     </dt>

     <dd>
<p class="para"> This array holds one or more key=&gt;value pairs to set attribute
      values for the type. The optional keywords are:</p>
      <dl>

       
        <dt>
<em><code class="parameter">open</code></em></dt>

        <dd>

         <p class="para">A flag to say whether the type is open. 
         An SDO_DataObject whose type is open can have properties added to 
         them which are not described by the type. This capability is used to 
         support working with XML documents whose schema support open content
         such as that described by an &lt;xsd:any&gt; element.
         The default value is &#039;false&#039;.
         </p>
        </dd>

       
       
        <dt>

         <em><code class="parameter">sequenced</code></em>
        </dt>

        <dd>

         <p class="para"> A flag to say whether the type is sequenced. 
         Sequenced types can have the ordering across properties preserved
         and can contain unstructured text. 
         The default value is &#039;false&#039;.
         For more information on sequenced types see the section on 
         <a href="sdo.sample.sequence.html" class="link">Working with Sequenced Data
         Objects</a>.
         </p>
        </dd>

       
       
        <dt>

         <em><code class="parameter">basetype</code></em>
        </dt>

        <dd>

         <p class="para"> If specified, an array of namespace URI and type name strings for the 
         type from which this type is derived. 
         An example of the use of base types is when a type derived in an XML 
         schema inherits from another type by using &lt;extension base=&quot;...&quot;&gt;.
         </p>
        </dd>

       
      </dl>

     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-sdo-das-datafactory.addtype-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   None.
  </p>
 </div>


 


 


 <div class="refsect1 examples" id="refsect1-sdo-das-datafactory.addtype-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-5347">
    <p><strong>Example #1 A
     <span class="function"><strong>SDO_DAS_DataFactory::addType()</strong></span>
example</strong></p>
    <div class="example-contents"><p>
The following adds a new data object type of &#039;CompanyType&#039;
where that type belongs to the namespace &#039;CompanyNS&#039;.
    </p></div>
    <div class="example-contents">
     <div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;$df</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addType</span><span style="color: #007700">(</span><span style="color: #DD0000">'CompanyNS'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'CompanyType'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>



 


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="sdo-das-datafactory.addpropertytotype.html">SDO_DAS_DataFactory::addPropertyToType</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="sdo-das-datafactory.getdatafactory.html">SDO_DAS_DataFactory::getDataFactory</a></div>
 <div class="up"><a href="ref.sdo.html">SDO 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
